<include file="Common:header"/>
<link rel="stylesheet" href="__PUBLIC__/css/style_wx.css">
<html>
<style>
body{
	background-color:#ffffff
}
.jiantou{
	top:38%
}
#middle_content .div_middle img{
		max-width:100%;
	}
#middle_content .div_middle{
	margin:5px;
	padding:8px;
	max-width: 580px;
	margin-right: auto;
	margin-left: auto;
}
.bds_qzone{
	background-position:0px;
	background-image:url('/Public/img/qqkj.png')
}
.tedit_body{
	padding:0 15px;
	background-color:#fff;
}
</style>
<body style="position:relative;margin:0 auto;">
	<div style="padding:50px 10px 10px 10px;color:red;">点击文章任意位置选中，可以对选中部分进行插入，删除等操作</div><!-- onclick="" 不能删除，他是兼容苹果手机点击触发不了编辑器问题 -->
	<div id="middle_content" onclick=""  class="tedit_body">
		<{:htmlspecialchars_decode($detail['content'])}>
	</div>
	
	<include file="Common:menu_edit_list"/>

	<include file="Common:success_bottom"/>

	<input type="hidden" id="aid" value="<{$detail['id']}>">
	<input type="hidden" id="seo_depict" value="<{$detail['seo_depict']}>">
	<input type="hidden" id="seo_key" value="<{$detail['seo_key']}>">
	<input type="hidden" id="select_item">
	<input type="hidden" id="activity-name" value="">
	<input type="hidden" id="select_item_b"><!--o-->
	<input type="hidden" id="form_music_id" name="musc" value="<{$detail['music_id']}>">	
	<input type="hidden" id="form_music" name="music" value="">	
	<include file="Common:display_title"/>	
</body>
</html>

<script>
	//控制视频宽度
	iframe_control();
	video_adapt();
	
	//提交
	function success(){
		var content = $('#middle_content').html();
		var aid     = $('#aid').val();
		var new_title = $('#new_title').val();
		var music_id = $('#form_music_id').val();
		var share_introduction = $('#share_introduction').val();	//分享图片
		var upload = $('#upload').val();		//分享图片
			
		if(new_title == ''){
			$('#banner').show();
			layer.open({
				content:'文章标题不能为空'
			});
			return false;
		}
		
		if(new_title != ''){
			title = new_title;
		}
		
		$('#middle_content').find('.css_background').removeClass('css_background');
		
		$.ajax({
			type: "POST",
			url: "<{:U('Home/Article/article_submit')}>",
			data: "content="+content+"&title="+title+"&type=1&aid="+aid+"&music_id="+music_id+"&share_introduction="+share_introduction+"&upload="+upload,
			success: function(msg){
				if(msg.status == '1'){
					layer.open({
   	                    content:'保存成功',
                        btn: ['确认'],
                        yes:function(){
                           window.location.href = msg.url;
                        }
                    });
				}else{
					layer.open({
						content:msg.msg
					});
				}
			}
		});
	}

	//显示 删除
	function success_show(){
		if($(".tedit_body *").hasClass('eing')){
			layer.open({
				content:'请取消编辑器在保存'
			});
			return false;
		}

		//修改文章时必须修改title
		if($('#banner').css('display') == 'none'){
			$('#banner').show();
			return false;
		}
		
		if($('#new_title').val() != ''){
			$('#affirm').click();
			return false;
		}
		$('#banner').show();
		$('body,html').addClass('ovfHiden');
		$('#new_title').focus();
		return false;
	}
	

</script>
